package week2.day12;

/**
 * @Author fengzihao
 * @Date 2024-04-26 20:37
 */
public class TestCar {
    public static void main(String[] args) {
        Car car = new Car("宝马","x7",588800);
        car.startEngine();
    }
}
class Car{
    private String brand;
    private String model;
    private double price;
    public Car() {
    }
    public Car(String brand, String model, double price) {
        this.brand = brand;
        this.model = model;
        this.price = price;
    }
    public void startEngine(){
        new Engine().run();
    }
    class Engine{
        public void run(){
            System.out.println("The car brand is " + brand + " price is " + price + " model is " + model + "  and the car is running");
        }
    }


}
